package edu.nf.placeorder.common.result;

import lombok.Data;

/**
 * @author wangl
 * @date 2025/9/28
 */
@Data
public class ResultVO {
    private Integer code;
    private String message;
    private Object data;

    public static <T>ResultVO success(T data) {
        ResultVO vo = new ResultVO();
        vo.setCode(200);
        vo.setData(data);
        return vo;
    }

    public static ResultVO success() {
        ResultVO vo = new ResultVO();
        vo.setCode(200);
        return vo;
    }

    public static ResultVO error(int code, String message) {
        ResultVO vo = new ResultVO();
        vo.setCode(code);
        vo.setMessage(message);
        return vo;
    }
}